// 引入http模块
const path = require('path')
const express = require('express')
const app = express()

app.use(
    express.json(),
    express.urlencoded()
)
 
//引入路由对象
const rootRouter = require('./router')
//2、接口服务器 模块化路由
app.use('/api',rootRouter)
app.use(rootRouter)




app.listen(3000,function(){
    console.log('服务器启动成功,端口为3000');
})